<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>编辑客户</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f5f8fa;
            font-family: 'Inter', sans-serif;
            padding: 20px;
        }
        .container {
            max-width: 600px;
            margin: 0 auto;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            padding: 25px;
        }
        h2 {
            color: #0f3460;
            margin-bottom: 20px;
            font-weight: 600;
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
            color: #333;
        }
        input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
        }
        input:focus {
            outline: none;
            border-color: #0f3460;
            box-shadow: 0 0 0 2px rgba(15, 52, 96, 0.2);
        }
        button[type="submit"] {
            background-color: #0f3460;
            color: white;
            border: none;
            border-radius: 6px;
            padding: 10px 15px;
            cursor: pointer;
            font-weight: 500;
            width: 100%;
            margin-top: 10px;
        }
        button[type="submit"]:hover {
            background-color: #1a508b;
        }
        .back-link {
            display: inline-block;
            margin-top: 20px;
            color: #0f3460;
            text-decoration: none;
            font-weight: 500;
        }
        .back-link:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>编辑客户信息</h2>
        <form method="post">
            <div class="form-group">
                <label for="name">姓名：</label>
                <input type="text" id="name" name="name" value="{{ customer.customerName }}" required>
            </div>
            <div class="form-group">
                <label for="pid">身份证号：</label>
                <input type="text" id="pid" name="pid" value="{{ customer.PID }}" required>
            </div>
            <div class="form-group">
                <label for="phone">联系电话：</label>
                <input type="text" id="phone" name="phone" value="{{ customer.telephone }}" required pattern="\d{11}">
            </div>
            <div class="form-group">
                <label for="address">联系地址：</label>
                <input type="text" id="address" name="address" value="{{ customer.address }}">
            </div>
            <button type="submit">
                <i class="fa fa-save"></i> 保存修改
            </button>
        </form>
        <a href="{{ url_for('admin.list_customers') }}" class="back-link">
            <i class="fa fa-arrow-left"></i> 返回客户列表
        </a>
    </div>
</body>
</html>